package com.blogsoho.taurus.dao.mapper;

import com.blogsoho.taurus.dao.builder.UserSqlBuilder;
import com.blogsoho.taurus.vo.UserVO;
import org.apache.ibatis.annotations.*;

/**
 * Created by user on 2017/6/15.
 */
@Mapper
public interface UserMapper {

    @Results(id = "userMapper", value = {
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
            @Result(property = "email", column = "email"),
            @Result(property = "active", column = "active"),
    })
    @SelectProvider(type = UserSqlBuilder.class, method = "getUserByName")
    public UserVO getUserByName(String name);

    @InsertProvider(type = UserSqlBuilder.class, method = "addUser")
    public int addUser(UserVO user);
}
